<?php
    // Send Header
    $xls->setHeader('Reporte_'.date('Y_m_d').'.xls');

    // XLS Data Cell
    $xls->BOF();
    $xls->writeLabel(1,0,"VENETEL");
    $xls->writeLabel(2,0,"Reporte de Personas : ");

    $xls->writeLabel(4,0,"Nombres");
    $xls->writeLabel(4,1,"Apellidos");
    $xls->writeLabel(4,2,"Rif");
    $xls->writeLabel(4,3,"Cedula");
    $xls->writeLabel(4,4,"Telefono");
    $xls->writeLabel(4,5,"fecha Ingreso");
    $xls->writeLabel(4,6,"Fecha egreso");
    $xls->writeLabel(4,7,"Fecha Nacimiento");
    $xls->writeLabel(4,8,"Razon Social");
    $xls->writeLabel(4,9,"Sw Activo");
    $xls->writeLabel(4,10,"Telefono Movil");
    $xls->writeLabel(4,11,"Cooperativa");
    $xls->writeLabel(4,12,"Tipo de empleado");
    $xls->writeLabel(4,13,"Correo");
    $xls->writeLabel(4,14,"Correo 2");
    $xls->writeLabel(4,15,"Correo 3");
    $xls->writeLabel(4,16,"Nro. Certificado");


	$x = 5;
	$y = 0;

	foreach ($personas as $persona){
    $xls->writeLabel($x, $y++, $persona['Persona']['nombres']);
    $xls->writeLabel($x, $y++, $persona['Persona']['apellidos']);
    $xls->writeLabel($x, $y++, $persona['Persona']['rif']);
    $xls->writeLabel($x, $y++, $persona['Persona']['cedula']);
    $xls->writeLabel($x, $y++, $persona['Persona']['telefono']);
    $xls->writeLabel($x, $y++, $persona['Persona']['fl_ingreso']);
    $xls->writeLabel($x, $y++, $persona['Persona']['fl_egreso']);
	$xls->writeLabel($x, $y++, $persona['Persona']['fecha_nacimiento']);
    $xls->writeLabel($x, $y++, $persona['Persona']['razon_social']);
	$xls->writeLabel($x, $y++, $persona['Persona']['sw_activo']);
	$xls->writeLabel($x, $y++, $persona['Persona']['telefono_movil']);
	$xls->writeLabel($x, $y++, $persona['Persona']['cooperativa']);
	$xls->writeLabel($x, $y++, $persona['Persona']['sw_tipo']);
    $xls->writeLabel($x, $y++, $persona['Persona']['correo']);
	$xls->writeLabel($x, $y++, $persona['Persona']['correo2']);
	$xls->writeLabel($x, $y++, $persona['Persona']['correo3']);
	$xls->writeLabel($x, $y++, $persona['Persona']['nro_cert']);
	$x++;
		if($y === 17) {
			$y = 0;
		}
	}

    $xls->EOF();
    exit();
?>